package com.ctsi.ssdc.domain;

import com.ctsi.ssdc.annotation.AutoId;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;

/**
 * @author ctsi-biyi-generator
*/
@ApiModel(description = "LitemallRegion")
public class LitemallRegion implements Serializable {
    /**
     * @Fields id 
     */
    @ApiModelProperty("")
    @AutoId(primaryKey = "id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Integer id;

    /**
     * @Fields pid 行政区域父ID，例如区县的pid指向市，市的pid指向省，省的pid则是0
     */
    @ApiModelProperty("pid")
    private Integer pid;

    /**
     * @Fields name 行政区域名称
     */
    @ApiModelProperty("name")
    private String name;

    /**
     * @Fields type 行政区域类型，如如1则是省， 如果是2则是市，如果是3则是区县
     */
    @ApiModelProperty("type")
    private Byte type;

    /**
     * @Fields code 行政区域编码
     */
    @ApiModelProperty("code")
    private Integer code;

    private static final long serialVersionUID = 1L;

    /** 
     * @return id 
     */
    public Integer getId() {
        return id;
    }

    /**
     * @param id 
     */
    public void setId(Integer id) {
        this.id = id;
    }

    /** 
     * @return pid 行政区域父ID，例如区县的pid指向市，市的pid指向省，省的pid则是0
     */
    public Integer getPid() {
        return pid;
    }

    /**
     * @param pid 行政区域父ID，例如区县的pid指向市，市的pid指向省，省的pid则是0
     */
    public void setPid(Integer pid) {
        this.pid = pid;
    }

    /** 
     * @return name 行政区域名称
     */
    public String getName() {
        return name;
    }

    /**
     * @param name 行政区域名称
     */
    public void setName(String name) {
        this.name = name == null ? null : name.trim();
    }

    /** 
     * @return type 行政区域类型，如如1则是省， 如果是2则是市，如果是3则是区县
     */
    public Byte getType() {
        return type;
    }

    /**
     * @param type 行政区域类型，如如1则是省， 如果是2则是市，如果是3则是区县
     */
    public void setType(Byte type) {
        this.type = type;
    }

    /** 
     * @return code 行政区域编码
     */
    public Integer getCode() {
        return code;
    }

    /**
     * @param code 行政区域编码
     */
    public void setCode(Integer code) {
        this.code = code;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        LitemallRegion other = (LitemallRegion) that;
        return (this.getId() == null ? other.getId() == null :
				 this.getId().equals(other.getId()))
            && (this.getPid() == null ? other.getPid() == null :
				 this.getPid().equals(other.getPid()))
            && (this.getName() == null ? other.getName() == null :
				 this.getName().equals(other.getName()))
            && (this.getType() == null ? other.getType() == null :
				 this.getType().equals(other.getType()))
            && (this.getCode() == null ? other.getCode() == null :
				 this.getCode().equals(other.getCode()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getPid() == null) ? 0 : getPid().hashCode());
        result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
        result = prime * result + ((getType() == null) ? 0 : getType().hashCode());
        result = prime * result + ((getCode() == null) ? 0 : getCode().hashCode());
        return result;
    }
}